package com.qq2008.game.mojie.jdo;

import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;

/***
 * 基础角色
 */
@Data
public class Player {
    // 编号
    protected int id = 0;

    // 名称
    @TableField(exist = false)
    protected String name = "";

    // 昵称
    protected String nickName = "";

    // 头像ID
    protected String headImg = "";

    // 等级
    protected int level = 0;

    // 当前血量
    protected int hp = 0;

    // 最大血量
    @TableField("max_hp")
    protected int maxHP = 0;

    // 当前魔力
    protected int mp = 0;

    // 最大魔力
    @TableField("max_mp")
    protected int maxMP = 0;

    // 最小攻击
    protected int minAttack = 0;

    // 最大攻击
    protected int maxAttack = 0;

    // 最大防御
    protected int minDefence = 0;

    // 最大防御
    protected int maxDefence = 0;

    // 所在地图ID
    protected int roomId = 0;

    // 战斗
    @TableField(exist = false)
    protected Battle battle = null;

    // 攻速
    protected int speed = 0;

    // 是否死亡
    @TableField(exist = false)
    protected Boolean dead = false;


    // ----------------------------------------------------------
    // FUNCTION
    // ----------------------------------------------------------
    public void death(){
        this.dead = true;
    }

    public void relife(){
        this.hp = this.maxHP;
        this.mp = this.maxMP;
        this.dead = false;
    }

}
